﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace Catalog.API.Model
{
    /// <summary>
    /// 快递点
    /// </summary>
    public class ExpressStore
    {
        public int Id { get; private set; }
        /// <summary>
        /// 快递店铺代码
        /// </summary>
        public string ExpressStoreCode { get; private set; }
        /// <summary>
        /// 快递店名称
        /// </summary>
        public string Name { get;  set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string Phone { get;  set; }
        /// <summary>
        /// 店铺所属人
        /// </summary>
        public string OwnerId { get;  set; }
        /// <summary>
        /// 联系人
        /// </summary>
        public string ContactMan { get;  set; }
        /// <summary>
        /// 门店状态(0:开业 1:注销)
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUserId { get; private set; }
        /// <summary>
        /// 修改人
        /// </summary>
        public string ModifyUserId { get;  set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; private set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
        public ExpressStore() { }

        public ExpressStore(string name,string phone,string ownerId,string contactMan, string createUserId)
        {
            this.ExpressStoreCode = Guid.NewGuid().ToString("N");
            this.Name = name;
            this.Phone = phone;
            this.OwnerId = ownerId;
            this.ContactMan = contactMan;
            this.CreateUserId = createUserId;
            this.Status = 0;
            this.CreateTime = DateTime.Now;
        }
        public void SetExpressStoreClose()
        {
            this.Status = 1;
        }
    }
}
